<template>

  <!-- header -->
  <div class="nav-container page-component">
    <!--左侧导航 #start -->
    <div class="nav left-nav">
      <div class="nav-item ">
        <span
          class="v-link clickable dark"
          onclick="javascript:window.location='/user'"
        >实名认证 </span>
      </div>
      <div class="nav-item ">
        <span
          class="v-link clickable dark"
          onclick="javascript:window.location='/order'"
        > 挂号订单 </span>
      </div>
      <div class="nav-item">
        <span
          class="v-link clickable dark"
          onclick="javascript:window.location='/patient'"
        > 就诊人管理 </span>
      </div>
      <div class="nav-item ">
        <span class="v-link clickable dark" onclick="javascript:window.location='/Sum.html'"> 大数据统计可视化</span>
      </div>
      <div class="nav-item selected">
        <span class="v-link selected dark" onclick="javascript:window.location='/scan'"> 医疗数据识别</span>
      </div>
<!--      <div class="nav-item ">-->
<!--        <span class="v-link clickable dark"> 修改账号信息 </span>-->
<!--      </div>-->
      <div class="nav-item ">
        <span class="v-link clickable dark"> 意见反馈 </span>
      </div>
    </div>
    <!-- 左侧导航 #end -->

    <!-- 右侧内容 #start -->
    <div class="page-container">
      <div class="personal-patient">
        <div class="header-wrapper">
          <div class="title"> 医疗数据识别</div>
        </div>

        <div class="content-wrapper"  style="{color : #00c25f}">
          <el-upload
            class="upload-demo"
            drag
            :action="blFileUrl"
            :on-success="onUploadCaseSheet"
            multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
            <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
          </el-upload>



        </div>
        <div class="content-wrappe"  >
          <el-form :label-position="labelPosition" label-width="80px" :model="formLabelAlign">
            <el-form-item  prop="name"
                           label="姓名:">
              <div class="name-input">
                {{dataAuth.Name.word}}
              </div>
            </el-form-item>
            <el-form-item label="性别:">
              <div class="name-input">
                {{dataAuth.Sex.word!=1?'女':'男'}}
              </div>
            </el-form-item>
            <el-form-item label="民族:">
              <div class="name-input">
                {{dataAuth.Nation.word}}
              </div>
            </el-form-item>
            <el-form-item label="国籍:">
              <div class="name-input">
                {{dataAuth.Nationality.word}}
              </div>
            </el-form-item>
            <el-form-item label="出生:">
              <div class="name-input">
                {{dataAuth.Birthday.word}}
              </div>
            </el-form-item>
            <el-form-item label="身份证号:">
              <div class="name-input">
                {{dataAuth.ID.word}}
              </div>
            </el-form-item>

          </el-form>

          <el-card class="box-card" >
            <div slot="header" class="clearfix" shadow="hover">
              <span>其他信息</span>

            </div>

            <div class="text item" >
              {{dataAuth}}
            </div>
          </el-card>

        </div>



        <el-row class="bottom">




          <el-button type="primary" icon="el-icon-picture-outline">取消</el-button>
          <el-button type="primary" >上传<i class="el-icon-upload el-icon--right"></i></el-button>

        </el-row>
      </div>
    </div>
    <!-- 右侧内容 #end -->
  </div>
  <!-- footer -->
</template>

<script>
import '~/assets/css/hospital_personal.css'
import '~/assets/css/hospital.css'
import '~/assets/css/personal.css'

import patientApi from '@/api/patient'

export default {

  data () {
    return {
      patientList: [],
      blFileUrl: 'http://localhost:8080/api/oss/file/uploadrecord', //上传接口的完整路径
      dataAuth: {
        Name:{
          word:""
        },
        Sex:{
          word:"1"
        },
        Age:{
          word:""
        },
        Birthday:{
          word:""
        },
        Nationality:{
          word:""
        },
        Nation:{
          word:""
        },
        ID:{
          word:""
        },
      },
    }
  },

  created () {
    this.findPatientList()
  },

  methods: {
    findPatientList () {

      patientApi.findList().then(response => {
        this.patientList = response.data
      })
    },

    add () {
      window.location.href = '/patient/add'
    },

    show (id) {
      window.location.href = '/patient/show?id=' + id
    },
    onUploadCaseSheet(response,file){
      if (response.code !== 200) {
        this.$message.error("上传失败")
        return
      }
      this.dataAuth=file.response.data.words_result
    }
  }
}
</script>
<style>
.header-wrapper .title {
  font-size: 16px;
  margin-top: 0;

}
.box-card{
  width: 500px;
}

.upload-demo{


}
.content-wrappe {
  /*position: absolute;*/
  /*top:50px;*/
  /*width:400px;*/
  float:left;
  margin-top: -2px;
  width:400px;
  height:500px;

}
.bottom{
  margin-top: 350px;
  position: absolute;
}
.content-wrapper {
  /*position: absolute;*/
  /*top:50px;*/
  float:left;
  width:400px;
  margin-top: 0px;
  margin-left: 0;
  height:400px;

}
.patient-card .el-card__header .detail {
  font-size: 14px;
}
</style>
